//-----------------------------------------------------------------------------
// Name: DisplayManager.h
// Auth: Bradford J. Smith
// Desc: contains all of the interface required to manipulate the view as well
//		as any additional state information.
//-----------------------------------------------------------------------------

#ifndef _DISPLAYMANAGER_
#define _DISPLAYMANAGER_

#include "SharedConstants.h"

//-----------------------------------------------------------------------------
// Constants:
//-----------------------------------------------------------------------------
const int kInitialWindowWidth = 600;
const int kInitialWindowHeight = 600;

const tVector3f kUpVector = {0.0f, 1.0f, 0.0f};

//-----------------------------------------------------------------------------
// cDisplayManager:
//-----------------------------------------------------------------------------
class cDisplayManager
{
public:
	// Constructers:
	cDisplayManager();
	~cDisplayManager();

	void Init();
	void Shutdown();

	// DisplayManager:
	void SetWindowArea(int width, int height);
	int GetWindowWidth();
	int GetWindowHeight();

	//-----------------------------------------------------------------------------
	void SetPerspectiveMode();
	void SetOrthographicMode();
	void UpdateProjection();
	// Desc: controls how the world's projection matrix is created and updated.

	//-----------------------------------------------------------------------------
	void SetCameraPitch(float pitch);
	void SetCameraHeading(float heading);
	void SetCameraOffset(float offset);
	float GetCameraPitch();
	float GetCameraHeading();
	float GetCameraOffset();
	// Desc: allows for basic polar camera manipulation

	//-----------------------------------------------------------------------------
	void UpdateCamera();
	// Desc: directly configures the model view matrix based on the camera data.
	//	Resets the matrix to identity before it does this.

	//-----------------------------------------------------------------------------
	void DrawDebugAxes();
	// Desc: uses lines and text to indicate the position of the coordinate frame

private:
	void SaveSettings();
	void LoadSettings();

	// Members:
	int mWindowWidth;
	int mWindowHeight;

	enum eProjectionMode
	{
		kOrthographic,
		kPerspective,
	};
	eProjectionMode mProjectionMode;
	
	// Camera Variables:
	tVector3f mCameraCOI; // center of interest.
	float mCameraPitch;
	float mCameraHeading;
	float mCameraOffset;
};

#endif